{extends file="./main.tpl"}
{block name=head}
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="./js/jquery.js" type="text/javascript"></script>
<script src="./js/jquery.dataTables.js" type="text/javascript"></script>

<style type="text/css">
  @import "./css/demo_table_jui.css";
  @import "./themes/ui-lightness/jquery-ui-1.8.4.custom.css";
</style>

<style>
  *{
      font-family: arial;
  }
</style>
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
    $('#datatables').dataTable({
      "sPaginationType":"full_numbers",
      "aaSorting":[[0, "asc"]],
      "bJQueryUI":true
    });
  })
</script>
{/block}
{block name=body}
<form action="summaryDetail.php" method=GET>
<div style="width: 700px;	margin: 30px auto;	padding: 0;">
<center><h1>Account Detail Summary</h1></center>
<input type="hidden" name="summDetail" value="{$summDetail}">
<table id="datatables" class="display">
  <thead>
  <tr>
    <th colspan="4">
    	<h2>Account Name : 
    	{if $summDetail == 0}
    	  {$accountName} {if $partyCode != ''}  --||-- Party Code : {$partyCode}{/if}</h2>
      {else}
        <select name="accountId" onchange="this.form.submit();">
          <option>Select Account</option>
            {html_options values=$partyArray.accountId output=$partyArray.accountName selected=$accountId}
        </select>
        </h2>
    {/if}    	  
    </th>
  </tr>
  <tr style="font-size:13px;">
  	<th>Date</th>
  	<th>Voucher No.</th>
  	<th>Credit</th>
    <th>Debit</th>
  </tr>
  </thead>
  <thead>
  <tr style="font-size:13px;">
  	<th align="right" colspan="2">Opening :</th>
  	{if $openingDrCr == 'Cr'}
  	  <th align="right">{$opening|string_format:"%.2f"}&nbsp;&nbsp;</th>
  	  <th align="right">&nbsp;</th>
  	{else}
      <th align="right">&nbsp;</th>
      <th align="right">{$opening|string_format:"%.2f"}&nbsp;&nbsp;</th>
    {/if}
  </tr>
  </thead>
  <tbody>
 {section name="sec" loop=$accArray}
  <tr style="font-size:13px;">
  	<td>{$accArray[sec].transDate|date_format:"%d - %m - %Y"}</td>
  	<td>
  		<a href="voucherDetail.php?transMasterId={$accArray[sec].transMasterId}">{$accArray[sec].voucherNo}</a>
  		{if $accArray[sec].loanId > 0}
    		<a href="loanEdit.php?loanDetailId={$accArray[sec].loanId}" class="button">IF-{$accArray[sec].loanId}</a>
    	{/if}
  	</td>
  	<td align="right"><font color="blue">{$accArray[sec].crAmount|string_format:"%.2f"}</font></td>
  	<td align="right"><font color="red">{$accArray[sec].drAmount|string_format:"%.2f"}</font></td>
  </tr>	
  {/section}
  </tbody>
  <tfoot>
	<tr style="font-size:13px;">
		<th align="right" colspan="2">Total : </th>
		<th align="right"><b><font color="blue">{$totalCrAmount|string_format:"%.2f"}</b></font>&nbsp;&nbsp;</th>
		<th align="right"><b><font color="red">{$totalDrAmount|string_format:"%.2f"}</b></font>&nbsp;&nbsp;</th>
	</tr>   	
  <tr style="font-size:13px;">
  	<th colspan="2" align="right">Final Amount: </th>
  	<th colspan="2"><b>{$finalAmount|string_format:"%.2f"}</b></th>
  </tr>
  </tfoot>
</table>
</div>
</form>
{/block}